public class Game {
    private Computer computer = new Computer();
    private Player player = new Player();

    public void play() {
            int score = 0;
            int shitou = 0;
            int jiandao =1;
            int bu =2;
            for (int i = 0; i < 5; i++) {
                System.out.println("第" + (i + 1) + "局");
                computer.generate();
                int computerNumber = computer.getNumber();
                player.generate();
                int playerNumber = player.getNumber();
                if (computerNumber == shitou) {
                    if (playerNumber == shitou){
                        System.out.println("平局，当前得分为：" + score);
                    }else if (playerNumber == jiandao){
                        score -= 1;
                        System.out.println("输了扣1分,当前得分为：" + score);
                    }else if (playerNumber == bu){
                        score += 3;
                        System.out.println("胜利加3分，当前得分为：" + score);
                    }

                }else if (computerNumber == bu){
                    if (playerNumber == bu){
                        System.out.println("平局，当前得分为：" + score);
                    }else if (playerNumber == shitou){
                        score -= 1;
                        System.out.println("输了扣1分,当前得分为：" + score);
                    }else if (playerNumber == jiandao){
                        score += 3;
                        System.out.println("胜利加3分，当前得分为：" + score);
                    }
                }else if (computerNumber == jiandao){
                    if (playerNumber == jiandao){
                        System.out.println("平局，当前得分为：" + score);
                    }else if (playerNumber == bu){
                        score -= 1;
                        System.out.println("输了扣1分,当前得分为：" + score);
                    }else if (playerNumber == shitou){
                        score += 3;
                        System.out.println("胜利加3分，当前得分为：" + score);
                    }
                }

            }
            if (score > 0) {
                System.out.println("恭喜你赢了！总得分为：" + score);
            } else {
                System.out.println("你输了 得分为:" + score);
            }
        }


    public static void main(String[] args) {
        Game game = new Game();
        game.play();
    }
}
